import React from 'react';
import { WeaTop } from 'ecCom';
import ListView from './ListView';
import { observer } from 'mobx-react';
import { Spin } from "antd";

@observer
export default class ItemList extends React.Component {
    render() {
        const { title, store } = this.props;
        return (
            <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@eyc5yc`}
                title={title}
                icon={<i className="icon-coms-government" />}
                iconBgcolor="#f14a2d" 
            >
                <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@259f1c`} spinning={store.prjListloading} >
                    <ListView ecId={`${this && this.props && this.props.ecId || ''}_ListView@w7gkrl`}
                        datas={store.prjList}
                        onItemClick={store.changeSelectedKey}
                        pagination={{
                            current: store.pagination.current,
                            pageSize: store.pagination.pageSize,
                            total: store.pagination.total,
                            onChange: store.onChangePaginNation
                        }}
                        currentKey={store.currentKey}
                        scrollHeight={store.commonStore.contentHeight - 120}
                        onSearchListItem={store.onSearchListItem}
                        onSearchChange={store.onSearchChange}
                        searchValue={store.searchValue}
                    />
                </Spin>
            </WeaTop>
        )
    }
}